package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.domain.db.BlackList;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 黑名单持久层接口
 */
public interface BlackListMapper extends BaseMapper<BlackList> {
    /**
     * 自定义语句分页查询
     * @param dbPage
     * @param userId
     * @return
     */
    @Select("select tui.*  from tb_black_list tbl,tb_user_info tui \n" +
            "where \n" +
            " tbl.black_user_id = tui.id and tbl.user_id = #{userId}")
    IPage<UserInfo> queryBlackList(Page<UserInfo> dbPage, @Param("userId") Long userId);
}
